package mcu.market.test;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import mcu.market.ibatis.IBatisFactory;
import mcu.market.ibatis.bean.BeanDailyPrice;
import mcu.market.util.DateUtil;

import org.apache.ibatis.session.SqlSession;

public class DB_Testing {
	/*public static void main(String[] args) throws IOException {
		Map map= new HashMap();
		map.put("id", 1);
		Object t= (Object)IBatisFactory.getInstance().getSqlSession()
		IBatisFactory.getInstance().getSqlSession().close();
		System.out.print(t);
	}            ---------------just test db */
	public static void main(String[] args) throws IOException {
	SqlSession sqlSession=IBatisFactory.getInstance().getSqlSession();
	Map map =new HashMap();
	map.put("sid", "test");
	map.put("rsi", 1);
	List<BeanDailyPrice> list=sqlSession.selectList("daily_price.selectPriceRSI",map);
	DateUtil du=new DateUtil();
	
	for(BeanDailyPrice bean:list){
		System.out.println(du.DateToString(bean.getDay(), "YYYY-MM-dd")+"  "+bean.getClose()+"  "+bean.getRsi());
		
	}
	sqlSession.commit();  
	sqlSession.close();
	}
}
